
<%@ page import="sar.StudentCourse" %>
<%@ page import="sar.StudentAttendant" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<title></title>
	</head>
	<body>
		<g:form action="tutorCheckAttendantReport" method="get"  controller="teachingReport">
			<table style="width: 750px;">
				<tr>
					<td colspan="2">
						<label for="programCourse">
							<g:message code="teachingSession.programCourse.label" default="Program Course" />
							<span class="required-indicator">*</span>
						</label>
						<g:select  id="programCourse" name="programCourse.id" from="${sar.ProgramCourse.list()}" optionKey="id" required="" value="${params.programCourse?.id}" class="many-to-one"/>
					</td>
					<td colspan="3">
						<label for="student">
							<g:message code="studentCourse.student.label" default="Student" />
							<span class="required-indicator">*</span>
						</label>
						<g:select id="student" name="student.id" from="${students}" optionKey="id" value="${params.student?.id}" class="many-to-one"/>
					</td>
				</tr>
				<tr>
					<td>
						From:
					</td>
					<td>
						<g:datePicker name="fromDate" precision="day"  value="${params.fromDate}"  />
					</td>
					<td>
						To:
					</td>
					<td>
						<g:datePicker name="toDate" precision="day"  value="${params.toDate}"  />
					</td>
					<td>
						<g:submitButton name="addComment" value="Find" />   
					</td>
				</tr>
			</table>
		</g:form>
		<table>
				<thead>
					<tr>
					
						<th><g:message code="studentAttendant.attendant.label" default="Attendant" /></th>
						
						<th>Absent</th>
					
						<th><g:message code="studentAttendant.studentCourse.label" default="Student Course" /></th>
					
						<th><g:message code="studentAttendant.teachingSession.label" default="Teaching Session" /></th>
					 
					 	<th><g:message
								code="studentAttendant.teachingSession.time.label"
								default="Time" /></th>
					</tr>
				</thead>
				<tbody>
				<g:each in="${studentAttendantInstanceList}" status="i" var="studentAttendantInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
						<g:radioGroup disabled="true" name="${studentAttendantInstance?.id }"
								values="[true,false]"
								value="${studentAttendantInstance?.attendant }">
								<td>
									${it.radio}
								</td>
							</g:radioGroup>
					
						<td>${fieldValue(bean: studentAttendantInstance, field: "studentCourse")}</td>
					
						<td>${fieldValue(bean: studentAttendantInstance, field: "teachingSession")}</td>
					
						<td>
								${fieldValue(bean: studentAttendantInstance, field: "teachingSession.time")}
							</td>
					</tr>
					<input type="hidden" name="${studentAttendantInstance.id}" value="${studentAttendantInstance.attendant}" />
				</g:each>
				
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${studentAttendantInstanceTotal}" />
			</div>
	</body>
</html>